package com.qkst.website.web.controller;


import java.io.IOException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.qkst.website.backstage.bean.CatalogBean;
import com.qkst.website.backstage.bean.CatgroupBean;
import com.qkst.website.common.core.BaseController;
import com.qkst.website.web.service.CatgroupService;

/**
 * @author lh
 * @description 前端产品目录控制器
 * @date 2017-06-12
 * @email ahlxlihao@163.com
 *
 */
@Controller
@RequestMapping("/web/catgroup")
public class WebCatgroupController extends BaseController{

	@Autowired
	private CatgroupService catgroupService;

	/**
	 * 查询所有目录
	 * @return
	 * @throws IOException 
	 */
	@RequestMapping(value = "/list.do", method = { RequestMethod.GET })
	public ModelAndView list(CatalogBean catalog) throws IOException{
		ModelAndView mv=this.backstageModelAndView("catgroup/list");
		List<CatgroupBean> catgroupList = catgroupService.list(catalog);
		mv.addObject("catgroupList", catgroupList);
		return mv;

	}
	

}
